<template>
  <div class="login" v-loading="loading" />
</template>
<script>
import { setToken } from '@/utils/auth'
export default {
  name: 'LoginPage',
  data () {
    return {
      loading: false
    }
  },
  mounted () {
    if (!this.$route.query.token) {
      this.$message.error('请先登录')
      return
    }
    if (!this.$route.query.customerNo) {
      this.$message.error('请选择煤矿')
      return
    }
    this.loading = true

    setToken(this.$route.query.token)
    this.$router.push(`/view?customerNo=${this.$route.query.customerNo}`)
    setTimeout(() => {
      this.loading = true
    }, 1000)
  }
}
</script>
<style lang="scss" scoped>
.login{
  width: 100%;
  height: 100%;
}
</style>
